package com.bw.unit3.view.adapter

import android.content.Context
import android.graphics.Color
import android.media.Image
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bw.unit3.R
import com.bw.unit3.bean.TypeGoodsBean
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 *
 * @ClassName: TypeAdapter
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/21 11:10 AM
 * @Version: 1.0
 */
class TypeGoodsAdapter(
    context: Context?, layoutId: Int, datas: List<TypeGoodsBean>?
) : CommonAdapter<TypeGoodsBean>(context, layoutId, datas) {
    override fun convert(holder: ViewHolder?, t: TypeGoodsBean?, position: Int) {
        val tv = holder?.getView<TextView>(R.id.tv_goods)
        tv?.text = t?.category_name

        val imageView = holder?.getView<ImageView>(R.id.iv)
        imageView?.let { Glide.with(mContext).load(t?.category_icon).into(it) }
    }


}